import {http} from "@/utils/http";

// 获取项目列表
export const getUnitNameListAPI=()=>{
    return http.get('/unitName/list')
}

//根据Id查询
export const getUnitNameInfoAPI=(id)=>{
    return http({
        method:'GET',
        url:`/unitName/getInfo/${id}`,
        params:{
            id
        }
    })
}

//新增
export const addOneUnitNameAPI=(oneUnitName)=>{
    return http.post('/unitName/save',oneUnitName)
}
//删除
export const deleteOneUnitNameAPI=(id)=>{
    return http.delete(`/unitName/remove/${id}`,{
        params:{
            id
        }
    })
}
//修改
export const updateOneUnitNameAPI=(oneUnitName)=> {
    return http.put('/unitName/update', oneUnitName)
}
//根据名称查询
export const getUnitNameByNameAPI=(unitName)=>{
    return http({
        method:'POST',
        url:`/unitName/getInfoByName`,
        data:unitName

    })
}